#include <stdio.h>
#include <stdlib.h>

#define SIZE 1000

int judgeAB(int n)
{
        int i = 0;
        int a[50] = {0};
        while (n)
        {
                a[i++] = n % 2;
                n /= 2;
        }
        int len = i;
        int tmp = 0;
        for (i = 0; i < len; i++) {
                if (a[i] == 1) {
                        tmp++;
                }
        }
        /* printf("1: %d, 2: %d\n", tmp, len-tmp);
        exit(1); */
        if (tmp > (len-tmp)) {
                return 1; // A
        } else {
                return -1;
        }
}

int main()
{
        int i;
        int A, B;
        A = B = 0;
        for (i = 1; i <= SIZE; i++) {
                if (judgeAB(i) == 1) {
                        A++;
                } else {
                        B++;
                }
        }
        printf("%d %d", A, B);
        return 0;
}